package com.liruo.learn.spring.mvc.controller.valid.custom;

import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;

import static java.lang.annotation.ElementType.*;
import static java.lang.annotation.RetentionPolicy.RUNTIME;

/**
 * @Author:liruo
 * @Date:2023-06-07-22:34:26
 * @Desc
 */
@Documented
@Constraint(validatedBy = CustomValidation.class)
@Target({ METHOD, FIELD, ANNOTATION_TYPE, CONSTRUCTOR, PARAMETER, TYPE_USE })
@Retention(RUNTIME)
public @interface CustomValid {
    String message() default "非法值";

    Class<?>[] groups() default {};

    Class<? extends Payload>[] payload() default {};
}
